import React, { Component } from 'react';
import MySwiper from "./MySwiper";
import MyEntry from "./MyEntry";
import MySeckill from "./MySeckill";
import '../styles/MyMain.css'
import { index_banner } from '../api/home';
class MyMain extends Component {
    constructor(props) {
        super(props)
        this.state = {
           bannerlist:[]
       }
    }
  
    componentDidMount() {
        index_banner().then((res) => {
            console.log(res.data.list)
            this.setState({bannerlist:res.data.list})
        })
    }
    render() {
        return (
            <div className='main'>
                <MySwiper banner={this.state.bannerlist}></MySwiper>
                <MyEntry></MyEntry>
                <MySeckill></MySeckill>
            </div>
        );
    }
}

export default MyMain;